import service from "../../utils/request";

export function isLogin() {
  return service.get("/login/isLogin");
}

type registerType = {
  username: string;
  password: string;
  nickName: string;
};

export function register(data: registerType) {
  return service.post("/login/register", data);
}

type Login = {
  username: string;
  password: string;
};
export function login(data: Login) {
  return service.post("/login/login", data);
}

export function getUserInfo() {
  return service.get("/login/getUserInfo");
}

export function logout() {
  return service.get("/login/loginOut");
}
